package com.dxy.lc.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import com.dxy.lc.base.Resp;
import com.dxy.lc.model.entity.Memo;
import com.dxy.lc.service.MemoService;



@Slf4j
@RestController
@RequestMapping("/lc/memo")
public class MemoController {

    @Autowired
    private MemoService service;

    @PostMapping("/add")
    public Resp add(@RequestBody Memo entity) {
        service.add(entity);
        return Resp.bizSuccess();
    }

    @PostMapping("/updById")
    public Resp updById(@RequestBody Memo entity) {
        service.updById(entity);
        return Resp.bizSuccess();
    }


    @GetMapping("/getUserMemo")
    public Resp<Memo> getUserMemo() {
        return Resp.bizSuccess(service.getUserMemo());
    }
}